<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/4/13 0013 19:29
 */


//这是所有已添加的好的网站，可以整个删除，可以前往template-list页面查看所有文件进行编辑
//
//显示的内容读取site文件夹下所有的文件夹


$list=[];
$objects = new DirectoryIterator('./site');
foreach ($objects as $object) {
    if ($object->isDir() && !$object->isDot()) {
        $name = $object->getFilename();
        $name = iconv("gb2312","utf-8",$name);
        $tmp['filename'] = $name;
        $tmp['time'] = $object->getCTime();
        if(strpos($name, '.') !== false) {
            continue;
        }

        list($tmp['category'], $tmp['name'], $tmp['time']) = explode('_', $name);
        $list[] = $tmp;
    }
}

function randLook($string, $time) {
    $total = 0;
    for ($i = 0; $i<strlen($string); $i++) {
        // var_dump($string[$i]);
        $total += ord($string[$i]);
    }
    return ceil((time() - $time) * $total / 50000);
}


?>

<!DOCTYPE html>
<!-- saved from url=(0098)http://www.jianshu.com/recommendations/collections?utm_medium=index-collections&utm_source=desktop -->
<html><!--<![endif]--><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <script type="text/javascript" src="./热门专题 - 简书_files/1255494d3a"></script><script src="./热门专题 - 简书_files/nr-1026.min.js.下载"></script><script src="./热门专题 - 简书_files/push.js.下载"></script><script async="" src="./热门专题 - 简书_files/analytics.js.下载"></script><script type="text/javascript">window.NREUM||(NREUM={});NREUM.info={"beacon":"bam.nr-data.net","errorBeacon":"bam.nr-data.net","licenseKey":"1255494d3a","applicationID":"15702971","transactionName":"e1daR0JWVV9RER9FUFtXWV5VV11SQApfWUYXW1tfXFxaR10MXkQ=","queueTime":3,"applicationTime":114,"agent":""}</script>
    <script type="text/javascript">window.NREUM||(NREUM={}),__nr_require=function(e,n,t){function r(t){if(!n[t]){var o=n[t]={exports:{}};e[t][0].call(o.exports,function(n){var o=e[t][1][n];return r(o||n)},o,o.exports)}return n[t].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<t.length;o++)r(t[o]);return r}({1:[function(e,n,t){function r(){}function o(e,n,t){return function(){return i(e,[c.now()].concat(u(arguments)),n?null:this,t),n?void 0:this}}var i=e("handle"),a=e(2),u=e(3),f=e("ee").get("tracer"),c=e("loader"),s=NREUM;"undefined"==typeof window.newrelic&&(newrelic=s);var p=["setPageViewName","setCustomAttribute","setErrorHandler","finished","addToTrace","inlineHit","addRelease"],d="api-",l=d+"ixn-";a(p,function(e,n){s[n]=o(d+n,!0,"api")}),s.addPageAction=o(d+"addPageAction",!0),s.setCurrentRouteName=o(d+"routeName",!0),n.exports=newrelic,s.interaction=function(){return(new r).get()};var m=r.prototype={createTracer:function(e,n){var t={},r=this,o="function"==typeof n;return i(l+"tracer",[c.now(),e,t],r),function(){if(f.emit((o?"":"no-")+"fn-start",[c.now(),r,o],t),o)try{return n.apply(this,arguments)}finally{f.emit("fn-end",[c.now()],t)}}}};a("setName,setAttribute,save,ignore,onEnd,getContext,end,get".split(","),function(e,n){m[n]=o(l+n)}),newrelic.noticeError=function(e){"string"==typeof e&&(e=new Error(e)),i("err",[e,c.now()])}},{}],2:[function(e,n,t){function r(e,n){var t=[],r="",i=0;for(r in e)o.call(e,r)&&(t[i]=n(r,e[r]),i+=1);return t}var o=Object.prototype.hasOwnProperty;n.exports=r},{}],3:[function(e,n,t){function r(e,n,t){n||(n=0),"undefined"==typeof t&&(t=e?e.length:0);for(var r=-1,o=t-n||0,i=Array(o<0?0:o);++r<o;)i[r]=e[n+r];return i}n.exports=r},{}],4:[function(e,n,t){n.exports={exists:"undefined"!=typeof window.performance&&window.performance.timing&&"undefined"!=typeof window.performance.timing.navigationStart}},{}],ee:[function(e,n,t){function r(){}function o(e){function n(e){return e&&e instanceof r?e:e?f(e,u,i):i()}function t(t,r,o,i){if(!d.aborted||i){e&&e(t,r,o);for(var a=n(o),u=m(t),f=u.length,c=0;c<f;c++)u[c].apply(a,r);var p=s[y[t]];return p&&p.push([b,t,r,a]),a}}function l(e,n){v[e]=m(e).concat(n)}function m(e){return v[e]||[]}function w(e){return p[e]=p[e]||o(t)}function g(e,n){c(e,function(e,t){n=n||"feature",y[t]=n,n in s||(s[n]=[])})}var v={},y={},b={on:l,emit:t,get:w,listeners:m,context:n,buffer:g,abort:a,aborted:!1};return b}function i(){return new r}function a(){(s.api||s.feature)&&(d.aborted=!0,s=d.backlog={})}var u="nr@context",f=e("gos"),c=e(2),s={},p={},d=n.exports=o();d.backlog=s},{}],gos:[function(e,n,t){function r(e,n,t){if(o.call(e,n))return e[n];var r=t();if(Object.defineProperty&&Object.keys)try{return Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!1}),r}catch(i){}return e[n]=r,r}var o=Object.prototype.hasOwnProperty;n.exports=r},{}],handle:[function(e,n,t){function r(e,n,t,r){o.buffer([e],r),o.emit(e,n,t)}var o=e("ee").get("handle");n.exports=r,r.ee=o},{}],id:[function(e,n,t){function r(e){var n=typeof e;return!e||"object"!==n&&"function"!==n?-1:e===window?0:a(e,i,function(){return o++})}var o=1,i="nr@id",a=e("gos");n.exports=r},{}],loader:[function(e,n,t){function r(){if(!x++){var e=h.info=NREUM.info,n=d.getElementsByTagName("script")[0];if(setTimeout(s.abort,3e4),!(e&&e.licenseKey&&e.applicationID&&n))return s.abort();c(y,function(n,t){e[n]||(e[n]=t)}),f("mark",["onload",a()+h.offset],null,"api");var t=d.createElement("script");t.src="https://"+e.agent,n.parentNode.insertBefore(t,n)}}function o(){"complete"===d.readyState&&i()}function i(){f("mark",["domContent",a()+h.offset],null,"api")}function a(){return E.exists&&performance.now?Math.round(performance.now()):(u=Math.max((new Date).getTime(),u))-h.offset}var u=(new Date).getTime(),f=e("handle"),c=e(2),s=e("ee"),p=window,d=p.document,l="addEventListener",m="attachEvent",w=p.XMLHttpRequest,g=w&&w.prototype;NREUM.o={ST:setTimeout,CT:clearTimeout,XHR:w,REQ:p.Request,EV:p.Event,PR:p.Promise,MO:p.MutationObserver};var v=""+location,y={beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net",agent:"js-agent.newrelic.com/nr-1026.min.js"},b=w&&g&&g[l]&&!/CriOS/.test(navigator.userAgent),h=n.exports={offset:u,now:a,origin:v,features:{},xhrWrappable:b};e(1),d[l]?(d[l]("DOMContentLoaded",i,!1),p[l]("load",r,!1)):(d[m]("onreadystatechange",o),p[m]("onload",r)),f("mark",["firstbyte",u],null,"api");var x=0,E=e(4)},{}]},{},["loader"]);</script>
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <meta property="wb:webmaster" content="294ec9de89e7fadb">
    <meta property="qc:admins" content="104102651453316562112116375">
    <meta property="qc:admins" content="11635613706305617">
    <meta property="qc:admins" content="1163561616621163056375">
    <meta name="google-site-verification" content="cV4-qkUJZR6gmFeajx_UyPe47GW9vY6cnCrYtCHYNh4">
    <meta name="google-site-verification" content="HF7lfF8YEGs1qtCE-kPml8Z469e2RHhGajy6JPVy5XI">
    <meta http-equiv="mobile-agent" content="format=html5; url=http://www.jianshu.com/recommendations/collections?utm_medium=index-collections&amp;utm_source=desktop">

    <!-- Apple -->
    <meta name="apple-mobile-web-app-title" content="简书">



    <title>热门专题 </title>

    <meta name="csrf-param" content="authenticity_token">
    <meta name="csrf-token" content="DApRWiyrfSHwdcZLb7WR6Rk+Eq8spub50GPOZJUkMw2IlEe0yV/mpHHbJyiRaqI4/sjDZJd4LR8YfZuzChDduA==">
    <link rel="stylesheet" href="./热门专题 - 简书_files/style.css">
    <link rel="stylesheet" media="all" href="./热门专题 - 简书_files/web-9562746e19037a8c27b1.css">

    <link rel="stylesheet" media="all" href="./热门专题 - 简书_files/entry-9562746e19037a8c27b1.css">

    <link href="http://cdn-qn0.jianshu.io/assets/favicons/favicon-ea87c042cbed82f63ec4cb18d1e1bc8b.ico" rel="icon">
    <link rel="apple-touch-icon-precomposed" href="http://cdn-qn0.jianshu.io/assets/apple-touch-icons/57-ce5a88a3e30a8f1f353e7b7e08710b47.png" sizes="57x57">
    <link rel="apple-touch-icon-precomposed" href="http://cdn-qn0.jianshu.io/assets/apple-touch-icons/72-d8f7a49ed070ff78bc7657785924d097.png" sizes="72x72">
    <link rel="apple-touch-icon-precomposed" href="http://cdn-qn0.jianshu.io/assets/apple-touch-icons/76-be915e70264c65090f03afff88e0f50c.png" sizes="76x76">
    <link rel="apple-touch-icon-precomposed" href="http://cdn-qn0.jianshu.io/assets/apple-touch-icons/114-fa410f47eef755b2aa43b94d63357102.png" sizes="114x114">
    <link rel="apple-touch-icon-precomposed" href="http://cdn-qn0.jianshu.io/assets/apple-touch-icons/120-50638ce65b8729b7761a4e68fe25724f.png" sizes="120x120">
    <link rel="apple-touch-icon-precomposed" href="http://cdn-qn0.jianshu.io/assets/apple-touch-icons/152-13b452db96e234a630d6d7bcbedbcd22.png" sizes="152x152">
</head>

<body lang="zh-CN" class="reader-black-font">
<!-- 全局顶部导航栏 -->
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
    <div class="width-limit">
        <!-- 左上方 Logo -->
        <a class="logo" href="">已建站点</a>

        

        <!-- 如果用户登录，显示下拉菜单 -->

        <div class="style-mode"><a class="style-mode-btn" style='font-size:17px;color:#333' href='list.php'>前往建站</a> <div class="popover-modal" style="left: 0px; display: none;"><div class="meta"><i class="iconfont ic-navigation-night"></i><span>夜间模式</span></div> <div class="switch day-night-group"><a class="switch-btn">开</a> <a class="switch-btn active">关</a></div> <hr> <div class="switch font-family-group"><a class="switch-btn font-song">宋体</a> <a class="switch-btn font-hei active">黑体</a></div> <div class="switch"><a class="switch-btn active">简</a> <a class="switch-btn">繁</a></div></div></div>
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#menu" aria-expanded="false">
                    <span class="icon-bar">asda</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
            </div>
            <div class="collapse navbar-collapse" id="menu">
           
            </div>
        </div>
    </div>
</nav>



<div class="container recommend">
    <img class="recommend-banner" src="./热门专题 - 简书_files/recommend-collection-58f8968955ecbeb8f8f3b4cd95ec76be.png" alt="Recommend collection">


    <div class="row" id="list-container">
        <?php foreach ($list as $value){ ?>
            <div class="col-xs-8">
                <div class="collection-wrap">
                    <a class="avatar-collection" target="_blank" href="javascript:;">
                        <img src="./template/<?= $value['category']?>_<?= $value['name']?>.jpg" alt="180">
                    </a>
                    <h4>
                        <a target="_blank" href="javascript:;">
                            <?= empty($value['name']) ? '未定义' : $value['name']?>
                        </a>
                    </h4>
                    <p class="collection-description">天之涯，海之角，欢迎建站
                     <a href="site/<?= $value['filename']?>" class="btn follow"><span>查看</span></a>
                    </p>
                   
                    <a href="template-list.php?site=site/<?= $value['filename']?>" class="btn  follow"><span>编辑</span></a>
                    <hr>
                    <div class="count"><a target="_blank" href="javascript:;"><?=randLook($value['name'], $value['time'])?>人查看</div>
                </div>
            </div>
        <?php }?>
    </div>

</div>

<script type="application/json" data-name="page-data">{"user_signed_in":false,"locale":"zh-CN","os":"windows","read_mode":"day","read_font":"font2"}</script>

<script src="./热门专题 - 简书_files/babel-polyfill-9562746e19037a8c27b1.js.下载"></script>
<script src="./热门专题 - 简书_files/web-base-9562746e19037a8c27b1.js.下载"></script>
<script src="./热门专题 - 简书_files/web-9562746e19037a8c27b1.js.下载"></script>

<script src="./热门专题 - 简书_files/entry-9562746e19037a8c27b1.js.下载"></script>
<script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-35169517-1', 'auto');
    ga('send', 'pageview');
</script>

<div style="display:none">
    <script src="./热门专题 - 简书_files/z_stat.php" language="JavaScript"></script><script src="./热门专题 - 简书_files/core.php" charset="utf-8" type="text/javascript"></script><a href="http://www.cnzz.com/stat/website.php?web_id=1258679142" target="_blank" title="站长统计">站长统计</a>
</div>

<script>
    (function(){
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        }
        else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>



</body></html>



